package com.letoken.platform.repo.admin.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.letoken.platform.repo.admin.po.AdminMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.letoken.platform.repo.admin.req.menu.GetMenuIdByUriReq;
import com.letoken.platform.repo.admin.req.menu.QueryAdminMenuReq;
import com.letoken.platform.repo.admin.req.menu.QueryPageReq;
import com.letoken.platform.repo.admin.req.menu.QueryResourcesReq;
import com.letoken.platform.repo.admin.res.menu.*;
import com.letoken.platform.repo.admin.res.system.QueryAdminMenuTreeRes;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 后台菜单表 Mapper 接口
 * </p>
 *
 * @author 作者
 * @since 2022-12-14
 */
public interface AdminMenuMapper extends BaseMapper<AdminMenu> {

    Page<QueryAdminMenuRes> queryAdminMenuList(@Param("page") Page<QueryAdminMenuRes> page, @Param("req") QueryAdminMenuReq req);

    Page<QueryResourcesRes> queryResourcesList(@Param("page") Page<QueryResourcesRes> page, @Param("req") QueryResourcesReq req);

    QueryResourcesByIdRes queryResourcesById(@Param("adminMenuId") Integer adminMenuId);

    List<QueryOneLevelRes> queryOneLevelList();

    List<QueryOneLevelRes> queryTwoLevelList(@Param("pId") Integer pId);

    List<QueryPermissionRes> queryPermissionById(@Param("adminRoleId") Integer adminRoleId);

    void deletePermissionById(@Param("adminRoleId") Integer adminRoleId);

    Integer getMenuIdByUri(GetMenuIdByUriReq req);

    Integer queryByUrl(@Param("uri") String uri);

    List<Integer> selectIdByPidList(@Param("adminMenuIdList") List<Integer> adminMenuIdList);

    List<Integer> selectPidByIdList(@Param("adminMenuIdList") List<Integer> adminMenuIdList);


    Page<QueryPageRes> queryPageList(@Param("page") Page<QueryPageRes> page, @Param("req") QueryPageReq req);

    QueryPageByIdRes queryPageById(@Param("adminMenuId") Integer adminMenuId);

    List<Integer> queryAllList();

    List<QueryAdminMenuTreeRes> getMenuList();

    List<QueryAdminMenuTreeRes> getAdminMenuIdList(@Param("adminMenuIdList") List<Integer> adminMenuIdList);
}
